<?php 
?>
<div class="comment" id="c<?php echo $data->id; ?>">

	<div class="author">
		<?php echo CHtml::link(CHtml::encode($data->title), "/index.php?r=site/showpost&id=".$data->id); ?>
		Posted By <?php echo $data->userid; ?> 
		At <?php echo date('F j, Y \a\t h:i a',$data->createdtime); ?> | 
		<?php echo CHtml::link('Reply',array('site/reply','id'=>$data->id)); ?> 
	</div>

	<div class="content">
		<?php echo nl2br(CHtml::encode($data->content)); ?>
	</div>
</div>
<hr> The Replies:
<?php foreach($reply as $k => $r):?>
<hr>
<div class="comment">Reply by <?php echo $r->userid; ?> 
At <?php echo date('F j, Y \a\t h:i a',$r->createdtime); ?>
</div>
<div class="comment" id="c<?php echo $r->id; ?>">
	<div class="content">
		<?php echo nl2br(CHtml::encode($r->content)); ?>
	</div>
</div>
<?php endforeach; ?>
<div id="page">  
<?php   
    $this->widget('CLinkPager',array(  
        'firstPageLabel'=>'First',  
        'lastPageLabel'=>'Last',  
        'prevPageLabel'=>'Prev',  
        'nextPageLabel'=>'Next',  
        'pages'=>$page,  
        'maxButtonCount'=>13,  
        )  
    );  
?>  
</div>  
